<!DOCTYPE html>
<html lang="zh">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="stylesheet" href="../../../static/css/login.css" />
  <title>登录</title>
  <script src="../../../static/js/jquery-3.6.3-min.js"></script>
</head>

<body>
  <div class="fu_div">
    <form class="login" action="/log" onsubmit="return sub();" method="post">
      <!-- csrf验证 -->
      {% csrf_token %}
      <h2>用户登录</h2>
      <hr class="login_hr" />
      <div class="login_box">
        <!-- required就是不能为空 必须在css效果中有很大的作用 -->
        <!-- 可以简写为required -->
        <input id="name" type="text" name="username" required value="{{username}}" /><label>用户名</label>
      </div>
      <div class="login_box">
        <input id="passwd" name="passwd" type="password" required="required" value="{{passwd}}" /><label>密码</label>

      </div>
      <div>
        <!-- 如果name="remember" value="1" 没有这两个选项, 点击登录是不会提交到服务器上的,这两个参数缺一不可 -->
        <input id="btn11" type="checkbox" name="remember" value="1" /><label for="btn11">记住用户名</label>
      </div>
      <div class="btn_fu">
        <input id="btn" class="submit_btn" type="submit" value="登录" />
        <a class="btn_login_reg" href="/reg">注册</a>
      </div>
    </form>

    <h3 id="tishi">{{error}}</h3>
  </div>
  <script src="../../../static/js/login.js"></script>
</body>

</html>